<table class="form-table-without-line">
    <tr>
        <th>号码01生肖</th>
        <td>
            <select data-am-selected>
                <option value="鼠">鼠</option>
                <option value="牛">牛</option>
                <option value="虎">虎</option>
                <option value="兔">兔</option>
                <option value="龙">龙</option>
                <option value="蛇">蛇</option>
                <option value="马">马</option>
                <option value="羊">羊</option>
                <option value="猴">猴</option>
                <option value="鸡">鸡</option>
                <option value="狗">狗</option>
                <option value="猪">猪</option>
            </select>
        </td>
    </tr>

    <tr>
        <th>金号码</th>
        <td>
            <input type="text" class="jin am-form-field" placeholder="请用,隔开数字"/>
        </td>
    </tr>

    <tr>
        <th>木号码</th>
        <td>
            <input type="text" class="mu am-form-field" placeholder="请用,隔开数字"/>
        </td>
    </tr>

    <tr>
        <th>水号码</th>
        <td>
            <input type="text" class="shui am-form-field" placeholder="请用,隔开数字"/>
        </td>
    </tr>

    <tr>
        <th>火号码</th>
        <td>
            <input type="text" class="huo am-form-field" placeholder="请用,隔开数字"/>
        </td>
    </tr>

    <tr>
        <th>土号码</th>
        <td>
            <input type="text" class="tu am-form-field" placeholder="请用,隔开数字"/>
            <button class="btn-save">提交</button>
        </td>
    </tr>
</table>

<script>
    Classify.query("lhc", "one", false, "鸡", function(r) {
        $(".form-table-without-line select").val(r);
        $(".form-table-without-line select").trigger('changed.selected.amui');
    });

    var fWuXing = function(key) {
        Classify.query("lhc", key, false, "", function(r) {
            $("." + key).val(r);
        });
    };
    var wuxing = ['jin', 'mu', 'shui', 'huo', 'tu'];
    for (var i in wuxing) fWuXing(wuxing[i]);

    $(".btn-save").click(function() {
        Classify.save("lhc", "one", $(".form-table-without-line select").val());

        for (var i in wuxing) {
            Classify.save("lhc", wuxing[i], $("." + wuxing[i]).val());
        }
        alert2("修改完成。");
    });
</script>
